FROM centos:7
MAINTAINER seal.jing<744327309@qq.com>

RUN yum update -y && yum install -y  openssl openssh-server  java-1.8.0-openjdk-devel.x86_64
RUN yum -y install openssh-clients
RUN yum -y install which
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
ENV HADOOP_HOME=/usr/local/hadoop-2.7.5
ENV PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
ENV HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop

RUN ssh-keygen -t rsa -f ~/.ssh/id_rsa -P '' && \
    cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

ADD hadoop-2.7.5.tar.gz /usr/local/
COPY config/* $HADOOP_CONF_DIR/
RUN mkdir -p /data/hdfs/namenode && \
    mkdir -p /data/hdfs/datanode && \
    mkdir -p /data/logs



